<template>
    <div id="Ath">
        <template v-if="Ath.FileType===1">

        </template>
        <template>
            <el-upload
                    :action="action"
                    list-type="picture-card"
                    :auto-upload="false"
                    multiple="true"
                    :file-list="fileList"
                    :accept="accept">
                <i slot="default" class="el-icon-plus"></i>
                <div slot="file" slot-scope="{file}">
                    <img class="el-upload-list__item-thumbnail"
                        :src="file.url" alt="">
                    <span class="el-upload-list__item-actions">
                        <span class="el-upload-list__item-preview"
                              @click="handlePictureCardPreview(file)">
                            <i class="el-icon-zoom-in"></i>
                        </span>
                        <span v-if="!disabled"
                            class="el-upload-list__item-delete"
                            @click="handleDownload(file)">
                            <i class="el-icon-download"></i>
                        </span>
                        <span v-if="!disabled"
                              class="el-upload-list__item-delete"
                              @click="handleRemove(file)">
                          <i class="el-icon-delete"></i>
                        </span>
                    </span>
                </div>
            </el-upload>
            <el-dialog :visible.sync="dialogVisible">
                <img width="100%" :src="dialogImageUrl" alt="">
            </el-dialog>
        </template>
    </div>
</template>
<script>
    export default {
        name: "Ath",
        props: {
            Ath: {
                type: Object
            },

        },
        data() {
            return {
                params: {},//参数
                webUser: {},
                action:"",//附件上传的路径
                fileList:[],//上传附件的集合
                accept:"*.*", //允许上传的格式
                //图片附件的参数
                dialogImageUrl: '',
                dialogVisible: false,
                disabled: false

            }
        },
        created(){

        },
        methods:{
            handleRemove(file) { //删除附件
                console.log(file);
            },
            handlePictureCardPreview(file) {//图片附件预览
                this.dialogImageUrl = file.url;
                this.dialogVisible = true;
            },
            handleDownload(file) { //附件下载
                console.log(file);
            }
        }
    }
</script>